{include file="public/header"}  
<body>
    <div class="wrapper">
        {include file="public/nav"}  
        <div id="page-wrapper" style="min-height: 325px;">
            <div class="row">
	            <div class="col-lg-12">
	                <h1 class="page-header">一般设置</h1>
	            </div>
            </div>
            <div class="row">

                <form id="form1" class="form" role="form" action="addgeneral" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="g-id" value="1">
                    {php}if($options['image'] != ''){ {/php}
                    <input type="hidden" name="water" value="{$options.image}">
                    {php}}else{{/php}
                    <input type="hidden" name="water" value="">
                    {php}}{/php}
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label>缩略图设置大小</label>
                            <div class="">
                                <div class="col-lg-2">
                                    
                                    <p><span>高度（以px为单位）：</span><input class="form-control" type="text" name="hight" value="{$options.width}"></p>
                                    <p class="help-block"></p>
                                </div>
                                <div class="col-lg-2">
                                    
                                    <p><span>宽度（以px为单位）：</span><input class="form-control" type="text" name="width" value="{$options.hight}"></p>
                                    <p class="help-block"></p>
                                </div>
                                <div class="col-lg-2">
                                    
                                    <p><span>水印透明度(1-100,100表示不透明)：</span><input class="form-control" type="text" name="transparent" value="{$options.transparent}"></p>
                                    <p class="help-block"></p>
                                </div>

                                <div class="col-lg-6">
                                    
                                    <p><span>水印字体（如果没有水印图片，可以用文字代替）：</span><input class="form-control" type="text" name="font" value="{$options.font}"></p>
                                    <p class="help-block"></p>
                                </div>
                                <div class="col-lg-2">
                                    <p><span>水印位置：（有9种位置）</span>
                                        <select class="form-control" name="fix">
                                            <option value="1" {php}if($options['fix'] == 1) echo "selected";{/php}>左上角</option>
                                            <option value="2" {php}if($options['fix'] == 2) echo "selected";{/php}>上居中</option>
                                            <option value="3" {php}if($options['fix'] == 3) echo "selected";{/php}>右上角</option>
                                            <option value="4" {php}if($options['fix'] == 4) echo "selected";{/php}>左居中</option>
                                            <option value="5" {php}if($options['fix'] == 5) echo "selected";{/php}>居中</option>
                                            <option value="6" {php}if($options['fix'] == 6) echo "selected";{/php}>右居中</option>
                                            <option value="7" {php}if($options['fix'] == 7) echo "selected";{/php}>左下角</option>
                                            <option value="8" {php}if($options['fix'] == 8) echo "selected";{/php}>下居中</option>
                                            <option value="9" {php}if($options['fix'] == 9) echo "selected";{/php}>左下角</option>
                                            
                                        </select>
                                    </p>
                                </div>
                                <div class="col-lg-2">
                                    <p>
                                        <span>偏移量</span>
                                        <input class="form-control" type="" name="offset" value="{$options.offset}">
                                </div>
                                    </p>
                            </div>
                        </div>
                        <div>
                            <div class="col-lg-12">
                                
                                <p>
                                    <span>水印图片：</span>
                                    <input class="form-control" type="file" name="image" value="{$options.image}">
                                </p>
                                <p class="help-block"></p>
                                <p>
                                    <img src="{$options.image}" class="thumbimage" />
                                </p>
                            </div>
                        </div>
                    </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <button class="btn btn-primary">确定</button>
                </div>
            </div>
                </form>

        </div>
    </div>
    </div>
    {include file="public/footer"}
    {include file="public/javascript"}
    <script type="text/javascript">
     var upimage = function(){
         /*      var formdata=new FormData($("#form1").[0]);获取文件法一 */
         var formdata=new FormData( ); 
         formdata.append("site_logo" , $("#file")[0].files[0]);//获取文件法二
         $.ajax({
             type : 'post',
             url : '/public/index.php/admin/system/uplogo',
             data : formdata,
             cache : false,
             processData : false, // 不处理发送的数据，因为data值是Formdata对象，不需要对数据做处理
             contentType : false, // 不设置Content-type请求头
             success : function(data){
                 $('#logo').attr('src',data);
             },
             error : function(){ }
         })
     }

    </script>
</body>
